package com.example.myapplication4;

import android.content.Context;
import android.view.View;
import android.widget.Toast;

public class ProxyOnClickListener implements View.OnClickListener{
    private View.OnClickListener listener;
    private Context mContext;

    public ProxyOnClickListener(Context mContex,View.OnClickListener listener){
        this.listener = listener;
        this.mContext = mContex;
    }


    @Override
    public void onClick(View v) {
        Toast.makeText(mContext,"拦截了点击事件",Toast.LENGTH_LONG).show();
        if(listener!=null){
            listener.onClick(v);
        }
    }
}
